//
//  UIView+Helper.h
//  LZLife
//
//  Created by 214 on 2021/3/16.
//

#import <UIKit/UIKit.h>

/// 边框类型(位移枚举)
typedef NS_ENUM(NSInteger, UIBorderSideType) {
    UIBorderSideTypeAll    = 0,
    UIBorderSideTypeTop    = 1 << 0,
    UIBorderSideTypeBottom = 1 << 1,
    UIBorderSideTypeLeft   = 1 << 2,
    UIBorderSideTypeRight  = 1 << 3,
};  

@interface UIView (Helper)

/// 起点x坐标
@property (nonatomic, assign) CGFloat customX;
/// 起点y坐标
@property (nonatomic, assign) CGFloat customY;
/// 中心点x坐标
@property (nonatomic, assign) CGFloat customCenterX;
/// 中心点y坐标
@property (nonatomic, assign) CGFloat customCenterY;
/// 宽度
@property (nonatomic, assign) CGFloat customWidth;
/// 高度
@property (nonatomic, assign) CGFloat customHeight;
/// 顶部
@property (nonatomic, assign) CGFloat customTop;
/// 底部
@property (nonatomic, assign) CGFloat customBottom;
/// 左边
@property (nonatomic, assign) CGFloat customLeft;
/// 右边
@property (nonatomic, assign) CGFloat customRight;
/// size
@property (nonatomic, assign) CGSize customSize;
/// origin
@property (nonatomic, assign) CGPoint customOrigin;

/// 设置圆角
- (void)rounded:(CGFloat)cornerRadius;

/// 设置圆角和边框
- (void)rounded:(CGFloat)cornerRadius width:(CGFloat)borderWidth color:(UIColor *)borderColor;

/// 设置边框
- (void)border:(CGFloat)borderWidth color:(UIColor *)borderColor;

/// 给哪几个角设置圆角
-(void)round:(CGFloat)cornerRadius RectCorners:(UIRectCorner)rectCorner;

/// 设置阴影
- (void)shadow:(UIColor *)shadowColor opacity:(CGFloat)opacity radius:(CGFloat)radius offset:(CGSize)offset;

/// 添加阴影效果
- (void)addShadowToView:(UIView *)theView withColor:(UIColor *)theColor;

- (UIViewController *)viewController;

+ (CGFloat)getLabelHeightByWidth:(CGFloat)width Title:(NSString *)title font:(UIFont *)font;

- (void)round:(CGFloat)cornerRadius RectCorners:(UIRectCorner)rectCorner  width:(CGFloat)borderWidth color:(UIColor *)borderColor ;

- (void)borderViewForColor:(UIColor *)color borderWidth:(CGFloat)borderWidth borderType:(UIBorderSideType)borderType;

@end

